﻿@model LynxWebLog.Areas.Blogs.ViewModels.PostEntry

@{
    ViewBag.Title = "Delete";
}

<h2>Delete</h2>

<h3>Are you sure you want to delete this?</h3>
<fieldset class="form-horizontal">
    <legend>PostEntry</legend>
    <div class="row">
        <div class="col-sm-2 col-md-2 col-lg-2">
            <div class="form-group">
                @Html.LabelFor(model => model.pd.postid, new { @class = "control-label", disabled = "disabled" })
                <div class="controls">
                    <input type="text" id="pd_postid" name="pd.postid" class="form-control input-sm" value="0" disabled="disabled" />
                    @Html.ValidationMessageFor(model => model.pd.postid, null, new { @class = "help-inline" })
                    <input type="hidden" name="pd.postid" id="hpd_postid" value="0" />
                </div>
            </div>
        </div>
        <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-6 col-md-5 col-lg-4">
            <div class="form-group">
                @Html.LabelFor(model => model.pd.blogid, new { @class = "control-label" })
                <div class="controls">
                    <input type="text" id="pd_blogid" name="pd.blogid" class="form-control input-sm" value=@ViewBag.BlogId disabled="disabled" />
                    @Html.ValidationMessageFor(model => model.pd.blogid, null, new { @class = "help-inline" })
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(model => model.pd.title, new { @class = "control-label" })
        <div class="controls">
            @Html.TextBoxFor(model => model.pd.title, new { @class = "form-control input-sm", disabled = "disabled" })
            @Html.ValidationMessageFor(model => model.pd.title, null, new { @class = "help-inline" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.pd.description, new { @class = "control-label" })
        <div class="controls">
            @Html.TextAreaFor(model => model.pd.description, new { @class = "form-control ckeditor", rows = "20", readOnly = "readOnly" })
            @Html.ValidationMessageFor(model => model.pd.description, null, new { @class = "help-inline" })
        </div>
    </div>
    <div class="row">
        <div class="col-sm-5 col-md-5 col-lg-5">
            <div class="form-group">
                @Html.LabelFor(model => model.categoryString, new { @class = "control-label" })
                <div class="controls">
                    @Html.TextBoxFor(model => model.categoryString, new { @class = "form-control input-sm", disabled = "disabled" })
                    @Html.ValidationMessageFor(model => model.categoryString, null, new { @class = "help-inline" })
                </div>
            </div>
        </div>
        <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-2 col-md-2 col-lg-2">
            <div class="form-group">
                @Html.LabelFor(model => model.pd.IsPublished, new { @class = "control-label" })
                <div class="controls">
                    @Html.CheckBoxFor(model => model.pd.IsPublished, new { disabled = "disabled" })
                    @Html.ValidationMessageFor(model => model.pd.IsPublished, null, new { @class = "help-inline" })
                </div>
            </div>
        </div>
        <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-3 col-md-3 col-lg-3">
            <div class="form-group">
                @Html.LabelFor(model => model.pd.dateCreated, new { @class = "control-label" })
                <div class="controls">
                    <input type="date" value="@string.Format("{0:yyyy-MM-dd}",Model.pd.dateCreated)" id="pd_dateCreated" disabled="disabled" class="form-control" />
                    @Html.ValidationMessageFor(model => model.pd.dateCreated, null, new { @class = "help-inline" })
                </div>
            </div>
        </div>
    </div>

</fieldset>
@using (Html.BeginForm("DeleteConfirmed", "PostEntry", FormMethod.Post)) {
    @Html.AntiForgeryToken()

    <div class="form-actions">
        <input type="hidden" id="postid" name="postid" value="@Model.pd.postid" />
        <input type="submit" value="Delete" class="btn btn-default btn-primary" /> |
        @Html.ActionLink("Back to List", "Index")
    </div>
}
@section Scripts {
    <script>
        $(document).ready(function () {
            CKEDITOR.on('instanceReady', function (ev) {
                editor = ev.editor;
                editor.setReadOnly(true);
            });
        });
    </script>
}